package com.xu.demo.proxyPattern;

//代理类
public class ShoppingProxy implements Shopping {
    private RealShopping realShopping;

    public ShoppingProxy(RealShopping realShopping) {
        this.realShopping = realShopping;
    }

    @Override
    public void buy() {
        System.out.println("开始记录日志");
        realShopping.buy();
        System.out.println("记录日志完成");
    }
}
